package com.fulu.designmode.structural.decorator_pattern;

/**
 * 结构型模式之装饰器模式
 * 步骤5： 使用RedShapeDecorator装饰Shape对象
 */
public class DecoratorPatternDemo {
    public static void main(String[] args) {
        Circle circle = new Circle();
        RedShapeDecorator redCircle = new RedShapeDecorator(new Circle());
        RedShapeDecorator redRectangle = new RedShapeDecorator(new Rectangle());

        System.out.println("normal circle");
        circle.draw();

        System.out.println("red border circle");
        redCircle.draw();

        System.out.println("red border rectangle");
        redRectangle.draw();
    }
}
